package com.yenlien.traceyun.business.controller;

import com.alibaba.fastjson.JSONObject;
import com.yenlien.traceyun.business.entity.StorageManageDetailed;
import com.yenlien.traceyun.business.interceptor.DataAuth;
import com.yenlien.traceyun.business.service.StorageManageDetailedService;
import com.yenlien.traceyun.webase.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 入库详情列表
 */
@RestController
@RequestMapping("/storeManageDetail")
public class StorageManageDetailedController extends BaseController {
    @Autowired
    private StorageManageDetailedService storageManageDetailedService;

    //分页查询列表
    @DataAuth
    @RequestMapping(value = "/findByList", method = RequestMethod.POST)
    public Object findByList(@RequestBody JSONObject params) {
        StorageManageDetailed storageManageDetailed = new StorageManageDetailed();
        storageManageDetailed.setProductName(params.getString("searchName"));
//        storageManageDetailed.setProcessBatch(params.getString("searchName"));
        storageManageDetailed.setType(params.getString("type"));
        storageManageDetailed.setPage(params.getIntValue("page"));
        return buildPage(storageManageDetailedService.findByList(storageManageDetailed));
    }
}
